﻿using Shinva.LADModel.Abstractions;
using Shinva.LADModel.Models;
using Shinva.Variables.Interface;
using Shinva.Variables.Type.bit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shinva.LADModel.Type.Custom
{
    public class CustomCall:ElementNodeBase
    {
        public string Name { get; set; } = "CustomFB";
        public string Description { get; set; } = "自定义功能块";
        public string CallType { get; set; } = "CustomFB";
        public string Version { get; set; } = "1.0.0";
        public string Author { get; set; } = "Shinva";
        public string Copyright { get; set; } = "Copyright © 2023 Shinva";
        public string License { get; set; } = "MIT";
        public string Instance { get; set; } = string.Empty;

        public override PlcBool EN
        {
            get;

            set;
            
        }
        public override PlcBool ENO
        {
            get
            ;
            set
            ;
        }
        public CustomCall()
        { 
        }

        public override IPlcMember GetInterfaceVariableByName(string name)
        {
            if (name == "in") return en;
            else if (name == "out") return ENO;
            else return variableTableInterface.GetVariableValue<IPlcMember>(name);
        }
    }
}
